package org.tuo.aop;

import org.fhawk.tinyspring.aop.annotation.Aspect;
import org.fhawk.tinyspring.aop.proxy.Proxy;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.lang.reflect.Method;

/**
 * Created by tuo on 10/9/16.
 */
@Aspect(pkg = "org.tuo.service")
public class serviceAspect implements Proxy {
    private Logger logger= LoggerFactory.getLogger(serviceAspect.class);

    @Override
    public void doBefore(Method method) {
        logger.info("=====service开始=====");
    }

    @Override
    public void doAfter(Method method) {
        logger.info("=====service结束=====");
    }

    @Override
    public void doFinally(Method method) {
        logger.info("=====service资源回收=====");
    }

    @Override
    public void doThrowable(Method method,Throwable e) {
        logger.info("=====service异常=====",e);
    }
}
